import {roleList} from '../../../request/api'

const state = {
    rolelist:[]
}

const getters={
    getRole(state){
        return state.rolelist
    }
}

const mutations={
    REQ_ROLELIST(state,payload){
        state.rolelist=payload
    }
}

const actions={
    getRoleListAction({commit}){
        roleList()
        .then(res=>{
            console.log(res);
            if(res.code==200){
                commit('REQ_ROLELIST',res.list)
            }
        })
    }
}
export default{
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}